﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MathNet.Numerics.LinearAlgebra.Double;
using MathNet.Numerics.LinearAlgebra.Generic;

namespace CubeRotation
{
    [Serializable]
    public class Point
    {
        public double X = 0;
        public double Y = 0;
        public double Z = 0;

        public Point(double X, double Y, double Z)
        {
            this.X = X;
            this.Y = Y;
            this.Z = Z;
        }

        public Vector<double> V()
        {
            Vector<double> v = new DenseVector(new double[] { X, Y, Z });
            return v;
        }

        public void Print()
        {
            string formatString = "{0,8:0.0000}";

            Console.WriteLine(String.Format(formatString, this.X) + ", " +
                               String.Format(formatString, this.Y) + ", " +
                               String.Format(formatString, this.Z));
        }

        public override string ToString()
        {
            return base.ToString() + ": " + X.ToString() + ", " + Y.ToString() + ", " + Z.ToString();
        }

        // Overloading '-' operator:
        public static Point operator -(Point a, Point b)
        {
            return new Point(a.X - b.X, a.Y - b.Y, a.Z - b.Z);
        }

        // Overloading '-' operator:
        public static Point operator +(Point a, Point b)
        {
            return new Point(a.X + b.X, a.Y + b.Y, a.Z + b.Z);
        }

        // Overloading '-' operator:
        public static Point operator /(Point a, double d)
        {
            return new Point(a.X / d, a.Y / d, a.Z / d);
        }

    }
}
